import { findSwiperList,findTypeList,findHotGoods } from "@/api/index";

Page({
  data:{
    // isLoading:true,
    // 轮播图数据
    bannerList:[],
    cateList:[],
    hotGoods:[]
  },
  async findSwiperList(){
    let data = await findSwiperList();
    this.setData({bannerList:data})
  },
  async findTypeList(){
    let data = await findTypeList()
    this.setData({cateList:data})
  },
  async findHotGoods(){
    let {records} = await findHotGoods()
    this.setData({hotGoods:records})
  },
  async onShow(){
    // this.setData({isLoading:true})
    this.findSwiperList()
    this.findTypeList()
    this.findHotGoods()
    // this.setData({isLoading:false})
  },
  onLoad(){
    console.log("加载中");
  }
})